]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Add mechanism to block animations
authorAdel Gadllah <adel.gadllah@gmail.com>
Wed, 16 Feb 2011 20:05:20 +0000 (21:05 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Tue, 8 Mar 2011 18:46:46 +0000 (19:46 +0100)
Add an API to allow blocking animations in situations where
they aren't desireable.

https://bugzilla.gnome.org/show_bug.cgi?id=642188

js/ui/windowManager.js

index deca70ed338e2f2e4fd69e1d91727df00a4d11e8..a10608f48d43a93a7d4b16b9633cc2e0b0ff6002 100644 (file)
@@ -93,6 +93,8 @@ WindowManager.prototype = {
 
         this._dimmedWindows = [];
 
+        this._animationBlockCount = 0;
+
         this._switchData = null;
         this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
         this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
@@ -139,8 +141,16 @@ WindowManager.prototype = {
             this._shellwm.connect('keybinding::' + keybinding, handler);
     },
 
+    blockAnimations: function() {
+        this._animationBlockCount++;
+    },
+
+    unblockAnimations: function() {
+        this._animationBlockCount = Math.max(0, this._animationBlockCount - 1);
+    },
+
     _shouldAnimate : function(actor) {
-        if (Main.overview.visible)
+        if (Main.overview.visible || this._animationsBlocked > 0)
             return false;
         if (actor && (actor.meta_window.get_window_type() != Meta.WindowType.NORMAL))
             return false;